from langchain_core.language_models.llms import LLM
from typing import (
    Any,
    AsyncIterator,
    Callable,
    Dict,
    Iterator,
    List,
    Mapping,
    Optional,
    Sequence,
    Tuple,
    Type,
    Union,
    cast,
)

from langchain_core.callbacks import (
    CallbackManagerForLLMRun,
)
class myllm(LLM):
    """my llm"""

    @property
    def _llm_type(self) -> str:
        """Return type of llm."""
        return "myllm"

    def _call(
        self,
        prompt: str,
        stop: Optional[List[str]] = None,
        run_manager: Optional[CallbackManagerForLLMRun] = None,
        **kwargs: Any,
    ) -> str:
        """Return next response"""
        print(prompt)
        return prompt[::-1]